<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>sock: sock::net::TcpServer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">sock
   &#160;<span id="projectnumber">v0.11</span>
   </div>
   <div id="projectbrief">C++ Network Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacesock.html">sock</a></li><li class="navelem"><a class="el" href="namespacesock_1_1net.html">net</a></li><li class="navelem"><a class="el" href="classsock_1_1net_1_1_tcp_server.html">TcpServer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classsock_1_1net_1_1_tcp_server-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sock::net::TcpServer Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="tcp__server_8h_source.html">tcp_server.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for sock::net::TcpServer:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classsock_1_1net_1_1_tcp_server.png" usemap="#sock::net::TcpServer_map" alt=""/>
  <map id="sock::net::TcpServer_map" name="sock::net::TcpServer_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_config.html">Config</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">配置数据  <a href="structsock_1_1net_1_1_tcp_server_1_1_config.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_statics.html">Statics</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">状态信息  <a href="structsock_1_1net_1_1_tcp_server_1_1_statics.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:abec9ec73a9e95554ec1dd46ebcebb26c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26c">Options</a> { <br />
&#160;&#160;<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26cae14a3e48f9466cf5533f6501065e5d8f">WORKER_NUM</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26ca52b8a6d182527f5cbf89ce8fcebd6b6b">HEARTBEAT_TIME</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26ca4b64346c3e4b3ae76cf612e103d98638">FRAME_TIME</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26ca0eb2364f1f8f1ee1f86670d030370bb3">CONN_ISSIZE</a>, 
<br />
&#160;&#160;<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26cad2dd1e3c9592315e4a98df0519c3b299">CONN_OSSIZE</a>
<br />
 }<tr class="memdesc:abec9ec73a9e95554ec1dd46ebcebb26c"><td class="mdescLeft">&#160;</td><td class="mdescRight">服务器配置参数  <a href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26c">More...</a><br /></td></tr>
<tr class="separator:abec9ec73a9e95554ec1dd46ebcebb26c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:afb7b447f9f67ed9f1a3f93e15f43b347"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347">State</a> { <a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347ae78386eefc569f2c07c58b66cb0751da">READY</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347add196db3e514c0fa131ec4b2e36ec25b">RUNNING</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347ad1b2046ce4c56bad7b7a9a090a7e2021">EXITING</a>, 
<a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347a0216946439f9bc60432110c9e2da378d">EXIT</a>
 }<tr class="memdesc:afb7b447f9f67ed9f1a3f93e15f43b347"><td class="mdescLeft">&#160;</td><td class="mdescRight">状态  <a href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347">More...</a><br /></td></tr>
<tr class="separator:afb7b447f9f67ed9f1a3f93e15f43b347"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad6d1a8405d96f2479c297918c396d212"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#ad6d1a8405d96f2479c297918c396d212">TcpServer</a> (void)</td></tr>
<tr class="separator:ad6d1a8405d96f2479c297918c396d212"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a226792a6bb7cccdb4eb6dfdf8851326c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a226792a6bb7cccdb4eb6dfdf8851326c">~TcpServer</a> (void)</td></tr>
<tr class="separator:a226792a6bb7cccdb4eb6dfdf8851326c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc40c8a3ac309ae92182de21a014d4cd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#afc40c8a3ac309ae92182de21a014d4cd">open</a> (const char *addr, int port, int backlog)</td></tr>
<tr class="memdesc:afc40c8a3ac309ae92182de21a014d4cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动服务器  <a href="#afc40c8a3ac309ae92182de21a014d4cd">More...</a><br /></td></tr>
<tr class="separator:afc40c8a3ac309ae92182de21a014d4cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a750bc64764b1277beee95ba9231f0f08"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a750bc64764b1277beee95ba9231f0f08">run</a> (void)</td></tr>
<tr class="memdesc:a750bc64764b1277beee95ba9231f0f08"><td class="mdescLeft">&#160;</td><td class="mdescRight">运行服务器  <a href="#a750bc64764b1277beee95ba9231f0f08">More...</a><br /></td></tr>
<tr class="separator:a750bc64764b1277beee95ba9231f0f08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8858c03e9c473d4a8313315c267fef28"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a8858c03e9c473d4a8313315c267fef28">close</a> (void)</td></tr>
<tr class="memdesc:a8858c03e9c473d4a8313315c267fef28"><td class="mdescLeft">&#160;</td><td class="mdescRight">关闭服务器  <a href="#a8858c03e9c473d4a8313315c267fef28">More...</a><br /></td></tr>
<tr class="separator:a8858c03e9c473d4a8313315c267fef28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a604b0305e6e7c6766af27dbd5a8f2d24"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a604b0305e6e7c6766af27dbd5a8f2d24">config</a> (<a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26c">Options</a> optname, void *optval)</td></tr>
<tr class="memdesc:a604b0305e6e7c6766af27dbd5a8f2d24"><td class="mdescLeft">&#160;</td><td class="mdescRight">配置服务器  <a href="#a604b0305e6e7c6766af27dbd5a8f2d24">More...</a><br /></td></tr>
<tr class="separator:a604b0305e6e7c6766af27dbd5a8f2d24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cd23b2b8566abc9d4f167b2c0488095"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a4cd23b2b8566abc9d4f167b2c0488095">setConnectionFactory</a> (<a class="el" href="namespacesock_1_1net.html#a2ddc58693b405832076a3d76dc133671">TcpConnectionFactoryPtr</a> factory)</td></tr>
<tr class="memdesc:a4cd23b2b8566abc9d4f167b2c0488095"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置连接工厂  <a href="#a4cd23b2b8566abc9d4f167b2c0488095">More...</a><br /></td></tr>
<tr class="separator:a4cd23b2b8566abc9d4f167b2c0488095"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa44d4d1608416e7fca8935090c5ef6ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#aa44d4d1608416e7fca8935090c5ef6ca">getStatics</a> (<a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_statics.html">Statics</a> &amp;statics)</td></tr>
<tr class="memdesc:aa44d4d1608416e7fca8935090c5ef6ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取服务器状态数据  <a href="#aa44d4d1608416e7fca8935090c5ef6ca">More...</a><br /></td></tr>
<tr class="separator:aa44d4d1608416e7fca8935090c5ef6ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1ca3065af98af784c65622431db16b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#ac1ca3065af98af784c65622431db16b5">getConfig</a> (<a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_config.html">Config</a> &amp;<a class="el" href="classsock_1_1net_1_1_tcp_server.html#a604b0305e6e7c6766af27dbd5a8f2d24">config</a>)</td></tr>
<tr class="memdesc:ac1ca3065af98af784c65622431db16b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取服务器当前配置  <a href="#ac1ca3065af98af784c65622431db16b5">More...</a><br /></td></tr>
<tr class="separator:ac1ca3065af98af784c65622431db16b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab68be9fc6db7094c2b6ca6b1650399e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#ab68be9fc6db7094c2b6ca6b1650399e3">setConnectionReadFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a836ed49de731537f208e17d07868a9d8">TcpConnection::TcpConnectionReadFunc</a> fn)</td></tr>
<tr class="memdesc:ab68be9fc6db7094c2b6ca6b1650399e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置读回调  <a href="#ab68be9fc6db7094c2b6ca6b1650399e3">More...</a><br /></td></tr>
<tr class="separator:ab68be9fc6db7094c2b6ca6b1650399e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae950d0e397409f17f8eaeb2d191abdd6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#ae950d0e397409f17f8eaeb2d191abdd6">setConnectionWriteFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_connection.html#ab8951d995ac681b06a8d8dfdadd219aa">TcpConnection::TcpConnectionWriteFunc</a> fn)</td></tr>
<tr class="memdesc:ae950d0e397409f17f8eaeb2d191abdd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置写回调  <a href="#ae950d0e397409f17f8eaeb2d191abdd6">More...</a><br /></td></tr>
<tr class="separator:ae950d0e397409f17f8eaeb2d191abdd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0641cbef81380437d1c420e9883a9840"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a0641cbef81380437d1c420e9883a9840">setConnectionErrorFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a> fn)</td></tr>
<tr class="memdesc:a0641cbef81380437d1c420e9883a9840"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置错误回调  <a href="#a0641cbef81380437d1c420e9883a9840">More...</a><br /></td></tr>
<tr class="separator:a0641cbef81380437d1c420e9883a9840"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fc6f8dc248d7338478316126bf37319"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a6fc6f8dc248d7338478316126bf37319">setConnectionCloseFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a> fn)</td></tr>
<tr class="memdesc:a6fc6f8dc248d7338478316126bf37319"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置关闭回调  <a href="#a6fc6f8dc248d7338478316126bf37319">More...</a><br /></td></tr>
<tr class="separator:a6fc6f8dc248d7338478316126bf37319"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add5343d5b2e2f7a7536fdb88a9dd4033"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#add5343d5b2e2f7a7536fdb88a9dd4033">setConnectionHeartbeatFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a> fn)</td></tr>
<tr class="memdesc:add5343d5b2e2f7a7536fdb88a9dd4033"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置心跳回调  <a href="#add5343d5b2e2f7a7536fdb88a9dd4033">More...</a><br /></td></tr>
<tr class="separator:add5343d5b2e2f7a7536fdb88a9dd4033"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed1da477683c9942e4c04f891b0050c5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#aed1da477683c9942e4c04f891b0050c5">setConnectionEstablishedFN</a> (<a class="el" href="classsock_1_1net_1_1_tcp_acceptor.html#a4f61b7c7e32c3cc975f394efbfced020">TcpAcceptor::PassTcpConnectionPtrRefFunc</a> fn)</td></tr>
<tr class="memdesc:aed1da477683c9942e4c04f891b0050c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置新连接回调  <a href="#aed1da477683c9942e4c04f891b0050c5">More...</a><br /></td></tr>
<tr class="separator:aed1da477683c9942e4c04f891b0050c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a43fe1eaa6c6b4d4ecbb2ba361d312b66"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a43fe1eaa6c6b4d4ecbb2ba361d312b66">TcpConnection</a></td></tr>
<tr class="separator:a43fe1eaa6c6b4d4ecbb2ba361d312b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0736aba6eec2f2c2a13494228473b67c"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#a0736aba6eec2f2c2a13494228473b67c">TcpWorker</a></td></tr>
<tr class="separator:a0736aba6eec2f2c2a13494228473b67c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>TCP服务器 </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26c">sock::net::TcpServer::Options</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>服务器配置参数 </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26cae14a3e48f9466cf5533f6501065e5d8f"></a>WORKER_NUM&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26ca52b8a6d182527f5cbf89ce8fcebd6b6b"></a>HEARTBEAT_TIME&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26ca4b64346c3e4b3ae76cf612e103d98638"></a>FRAME_TIME&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26ca0eb2364f1f8f1ee1f86670d030370bb3"></a>CONN_ISSIZE&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="abec9ec73a9e95554ec1dd46ebcebb26cad2dd1e3c9592315e4a98df0519c3b299"></a>CONN_OSSIZE&#160;</td><td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="afb7b447f9f67ed9f1a3f93e15f43b347"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classsock_1_1net_1_1_tcp_server.html#afb7b447f9f67ed9f1a3f93e15f43b347">sock::net::TcpServer::State</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>状态 </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="afb7b447f9f67ed9f1a3f93e15f43b347ae78386eefc569f2c07c58b66cb0751da"></a>READY&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afb7b447f9f67ed9f1a3f93e15f43b347add196db3e514c0fa131ec4b2e36ec25b"></a>RUNNING&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afb7b447f9f67ed9f1a3f93e15f43b347ad1b2046ce4c56bad7b7a9a090a7e2021"></a>EXITING&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afb7b447f9f67ed9f1a3f93e15f43b347a0216946439f9bc60432110c9e2da378d"></a>EXIT&#160;</td><td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad6d1a8405d96f2479c297918c396d212"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TcpServer::TcpServer </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a226792a6bb7cccdb4eb6dfdf8851326c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TcpServer::~TcpServer </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8858c03e9c473d4a8313315c267fef28"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TcpServer::close </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>关闭服务器 </p>

</div>
</div>
<a class="anchor" id="a604b0305e6e7c6766af27dbd5a8f2d24"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TcpServer::config </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_server.html#abec9ec73a9e95554ec1dd46ebcebb26c">Options</a>&#160;</td>
          <td class="paramname"><em>optname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>optval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>配置服务器 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">optname</td><td>选项名 </td></tr>
    <tr><td class="paramname">optval</td><td>选项值 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac1ca3065af98af784c65622431db16b5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TcpServer::getConfig </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_config.html">Config</a> &amp;&#160;</td>
          <td class="paramname"><em>config</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取服务器当前配置 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa44d4d1608416e7fca8935090c5ef6ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TcpServer::getStatics </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structsock_1_1net_1_1_tcp_server_1_1_statics.html">Statics</a> &amp;&#160;</td>
          <td class="paramname"><em>statics</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取服务器状态数据 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">statics</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afc40c8a3ac309ae92182de21a014d4cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TcpServer::open </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>backlog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动服务器 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>监听地址 </td></tr>
    <tr><td class="paramname">port</td><td>监听端口 </td></tr>
    <tr><td class="paramname">backlog</td><td>监听队列长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<a class="anchor" id="a750bc64764b1277beee95ba9231f0f08"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TcpServer::run </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>运行服务器 </p>

</div>
</div>
<a class="anchor" id="a6fc6f8dc248d7338478316126bf37319"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionCloseFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置关闭回调 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fn</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a0641cbef81380437d1c420e9883a9840"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionErrorFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置错误回调 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fn</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aed1da477683c9942e4c04f891b0050c5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionEstablishedFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_acceptor.html#a4f61b7c7e32c3cc975f394efbfced020">TcpAcceptor::PassTcpConnectionPtrRefFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置新连接回调 </p>

</div>
</div>
<a class="anchor" id="a4cd23b2b8566abc9d4f167b2c0488095"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionFactory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacesock_1_1net.html#a2ddc58693b405832076a3d76dc133671">TcpConnectionFactoryPtr</a>&#160;</td>
          <td class="paramname"><em>factory</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置连接工厂 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">factory</td><td>连接工厂 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="add5343d5b2e2f7a7536fdb88a9dd4033"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionHeartbeatFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a9d9ea93c3a51141616167ae78c0238ec">TcpConnection::PassTcpConnectionRefFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置心跳回调 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fn</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab68be9fc6db7094c2b6ca6b1650399e3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionReadFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_connection.html#a836ed49de731537f208e17d07868a9d8">TcpConnection::TcpConnectionReadFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置读回调 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fn</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae950d0e397409f17f8eaeb2d191abdd6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void sock::net::TcpServer::setConnectionWriteFN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsock_1_1net_1_1_tcp_connection.html#ab8951d995ac681b06a8d8dfdadd219aa">TcpConnection::TcpConnectionWriteFunc</a>&#160;</td>
          <td class="paramname"><em>fn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置写回调 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fn</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="a43fe1eaa6c6b4d4ecbb2ba361d312b66"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classsock_1_1net_1_1_tcp_connection.html">TcpConnection</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a0736aba6eec2f2c2a13494228473b67c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classsock_1_1net_1_1_tcp_worker.html">TcpWorker</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>E:/git/sock/sock/net/<a class="el" href="tcp__server_8h_source.html">tcp_server.h</a></li>
<li>E:/git/sock/src/net/<a class="el" href="tcp__server_8cc.html">tcp_server.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
